<template>
  <!-- 表格展示 -->
  <PageTableDisplay
    v-if="type === 'table'"
    @toggleType="(val:'table' | 'tree') => (type = val)"
  ></PageTableDisplay>

  <!-- 树状图展示 -->
  <PageTreeDisplay
    v-if="type === 'tree'"
    @toggleType="(val:'table' | 'tree') => (type = val)"
  ></PageTreeDisplay>
</template>

<script lang="ts" setup>
import { ref } from 'vue'
import PageTableDisplay from './PageTableDisplay.vue'
import PageTreeDisplay from './PageTreeDisplay.vue'

const type = ref<'table' | 'tree'>('table') // 展示类型，默认为表格展示
</script>
